<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>血液加工</title>
    <link rel="shortcut icon" type="image/x-icon" href="/img/favicon.ico">
    <link rel="stylesheet" href="/element-theme/blue/index.css">

</head>

<body>
<div class="data-manage-table">
    <template>

        <el-form ref="form" :inline="true" style="padding:0 20px 0 20px;">
            <!-- <el-button type="primary" style="margin-right: 40px;">批量删除</el-button> -->
            <el-form-item label="加工编号">
                <el-input v-model="pagination.id" placeholder="请输入加工编号"></el-input>
            </el-form-item>
            <el-form-item label="血液编号">
                <el-input v-model="pagination.bloodId" placeholder="请输入血液编号"></el-input>
            </el-form-item>
            <el-form-item label="加工状态">
                <el-select v-model="pagination.state">
                    <el-option v-for="item in processingStateList" :key="item.code" :label="item.name" :value="item.code"></el-option>
                </el-select>
            </el-form-item>


            <el-form-item>
                <el-button type="primary" @click="getByQueryPage(1)">搜索</el-button>
                <el-button type="info" @click="getByQueryPage()">清空</el-button>
                <el-button type="warning" @click="addDialogVisible = true">添加</el-button>
                <el-button type="warning" @click="test()">test</el-button>
            </el-form-item>
        </el-form>


        <el-table :data="tableData" style="width: 100%;" border :header-cell-style="{'text-align': 'center','background': '#eef1f6'}" highlight-current-row
                  @current-change=""  @row-click="rowClick" highlight-current-row="true" height="260">
            <el-table-column prop="processingId"         label="加工编号" width="200" align="center"></el-table-column>
            <el-table-column prop="processingMethod"     label="加工方法" width="100" align="center">
                <template slot-scope="scope">
                    {{ getProcessingMethodName(scope.row.processingMethod) }}
                </template>
            </el-table-column>
            <el-table-column prop="bloodId"   label="血液编号" width="100" align="center"></el-table-column>
            <el-table-column prop="bloodComponent"  label="血液成分" width="200" align="center">
                <template slot-scope="scope">
                    {{ getBloodComponentName(scope.row.bloodComponent) }}
                </template>
            </el-table-column>
            <el-table-column prop="failureTime"   label="失效时间" width="200" align="center"></el-table-column>
            <el-table-column prop="postComponent"  label="加工后血液成分" width="200" align="center">
                <template slot-scope="scope">
                    {{ getBloodComponentName(scope.row.postComponent) }}
                </template>
            </el-table-column>
            <el-table-column prop="postFailureTime"   label="加工后失效时间" width="200" align="center"></el-table-column>
            <el-table-column prop="processingState"               label="状态" width="100" align="center">
                <template slot-scope="scope">
                    {{ getProcessingStateName(scope.row.processingState) }}
                </template>
            </el-table-column>
            <el-table-column label="操作" width="240" align="center">
                <template slot-scope="scope">
                    <el-button size="mini" type="danger" @click="processingDialogVisible=true;processing(scope.row)"
                               :disabled="scope.row.processingState != '201'">加工完成</el-button>
                    <el-button size="mini" type="danger" @click="deleteConfirmDialog = true;getDelete(scope.row)"
                               :disabled="scope.row.processingState != '201'">删除</el-button>
                </template>
            </el-table-column>
        </el-table>

        <!-- 加工完成确认 -->
        <el-dialog title="加工信息确认" :visible.sync="processingDialogVisible" width="50%" :before-close="handleClose">
            <el-descriptions title="如未改变请置空" :column="1" border>
                <el-descriptions-item label="加工后血液成分">
                    <el-select v-model="processingForm.postComponent" clearable>
                        <el-option v-for="item in bloodComponentList" :key="item.code" :label="item.composition" :value="item.code"></el-option>
                    </el-select>
                </el-descriptions-item>
                <el-descriptions-item label="加工后失效时间">
                    <el-descriptions class="margin-top" title="" :column="2" border>
                        <el-descriptions-item>
                            <div class="block">
                                <span class="demonstration"></span>
                                <el-date-picker
                                        v-model="Date"
                                        align="right"
                                        type="date"
                                        placeholder="选择日期"
                                        format="yyyy 年 MM 月 dd 日"
                                        value-format="yyyy-MM-dd">
                                </el-date-picker>
                            </div>
                        </el-descriptions-item>
                        <el-descriptions-item>
                            <el-time-picker
                                    v-model="Time"
                                    placeholder="任意时间点"
                                    format="HH 时 mm 分 ss 秒"
                                    value-format="HH:mm:ss">
                            </el-time-picker>
                        </el-descriptions-item>
                    </el-descriptions>
                </el-descriptions-item>
            </el-descriptions>
            <span slot="footer" class="dialog-footer">
                    <el-button @click="processingDialogVisible = false">取 消</el-button>
                    <el-button type="primary" @click="processingConfirm">确 定</el-button>
                </span>
        </el-dialog>

        <!-- 删除确认 -->
        <el-dialog title="提示" :visible.sync="deleteConfirmDialog" width="30%" @close="cancel">
            <span>确认删除</span>
            <span slot="footer" class="dialog-footer">
                    <el-button @click="deleteConfirmDialog = false">取 消</el-button>
                    <el-button type="primary" @click="deleteOne()">确 定</el-button>
                </span>
        </el-dialog>

        <!--添加-->
        <el-dialog title="添加血液加工" :visible.sync="addDialogVisible" width="50%" :before-close="handleClose">
            <el-descriptions title="" :content-style="rowCenter" :label-style="rowCenter" :column="2" border>
                <el-descriptions-item label="加工血液">
                    <el-input v-model="bloodForm.bloodId" @change="((value)=>validateId(value))"></el-input>
                </el-descriptions-item>
                <el-descriptions-item label="加工方法">
                    <el-select v-model="bloodForm.processingMethod">
                        <el-option v-for="item in methodList" :key="item.code" :label="item.name" :value="item.code"></el-option>
                    </el-select>
                </el-descriptions-item>
                <el-descriptions-item>
                    <template slot="label" align="center">
                        血液编号
                    </template>
                    {{bloodData.bloodId}}
                </el-descriptions-item>
                <el-descriptions-item>
                    <template slot="label" align="center">
                        血液成分
                    </template>
                    {{bloodData.bloodComponent}}
                </el-descriptions-item>
                <el-descriptions-item>
                    <template slot="label" align="center">
                        ABO血型
                    </template>
                    {{bloodData.aboBloodType}}
                </el-descriptions-item>
                <el-descriptions-item>
                    <template slot="label" align="center">
                        Rh血型
                    </template>
                    {{bloodData.rhBloodType}}
                </el-descriptions-item>  <el-descriptions-item>
                <template slot="label" align="center">
                    规格
                </template>
                {{getBloodSizeName(bloodData.bloodCount)}}
            </el-descriptions-item>  <el-descriptions-item>
                <template slot="label" align="center">
                    扩展码
                </template>
                {{bloodData.extendCode}}
            </el-descriptions-item><el-descriptions-item>
                <template slot="label" align="center">
                    血袋编号
                </template>
                {{bloodData.barcode}}
            </el-descriptions-item><el-descriptions-item>
                <template slot="label" align="center">
                    采集时间
                </template>
                {{bloodData.collectTime}}
            </el-descriptions-item><el-descriptions-item>
                <template slot="label" align="center">
                    失效时间
                </template>
                {{bloodData.failureTime}}
            </el-descriptions-item><el-descriptions-item>
                <template slot="label" align="center">
                    金额
                </template>
                {{bloodData.bloodAmount}}
            </el-descriptions-item>
            </el-descriptions>

            <template>
                <div slot="footer" class="dialog-footer">
                    <el-button @click="addDialogVisible=false;handleClose()" type="warning" >取消</el-button>
                    <el-button @click="submit();handleClose()" type="primary" >提交</el-button>
                </div>
            </template>
        </el-dialog>


        <!--分组插件-->
        <div class="pagination-container">
            <el-pagination
                    class="pagination"
                    @size-change="handleSizeChange"
                    @current-change="handleCurrentChange"
                    :current-page="pagination.currentPage"
                    :page-sizes="[2,4,6,8,10]"
                    :page-size="pagination.pageSize"
                    layout="total, sizes, prev, pager, next, jumper"
                    :total="pagination.total"
                    style="text-align: center; margin-top: 10px; margin-bottom: 10px;">
            </el-pagination>
        </div>

    </template>

</div>



<!--<script src="/js/vue.min.js"></script>-->
<!--<script src = "/js/2.15.12/index.js"></script>-->
<!--<link href = "/css/2.15.12/index.css" rel="stylesheet">-->
<!--<script src="/plugins/axios-0.27.2/axios.min.js"></script>-->
<!--<script src="/icons/iconfont.js"></script>-->
<!--<script src="/js/httpVueLoader.js"></script>-->
<!--<script src="https://cdn.bootcdn.net/ajax/libs/qs/6.10.1/qs.js"></script>-->



<script src="/plugins/vue-2.6.11/vue.js"></script>
<script src="/plugins/element-2.4.5/index.js"></script>
<script src="/icons/iconfont.js"></script>
<script src="/js/axios.min.js"></script>
<script src="/js/2.15.12/index.js"></script>
<link href="/css/2.15.12/index.min.css" rel="stylesheet">
<script src="/js/httpVueLoader.js"></script>
<script src="/js/jquery.min.js"></script>
<script>Vue.prototype.$ELEMENT = { size: 'medium' };</script>



<script>

    (function () {


        var vm = window.vm = new Vue({
            el: '.data-manage-table',
            data() {
                return {
                    rowCenter:{
                        "text-align":"center"
                    },

                    Time: '',
                    //日期
                    Date: '',

                    //加工完成
                    processingForm:{
                        processingId: '',
                        postComponent:'',
                        postFailureTime:''
                    },
                    processingDialogVisible:false,
                    //加工方法字典
                    methodList:[],

                    //添加血液加工dialog
                    addDialogVisible:false,
                    bloodForm:{
                        bloodId:'',
                        processingMethod:''
                    },

                    //删除确认
                    delete:'',
                    deleteConfirmDialog:false,
                    //
                    processingStateList:[],
                    //申请状态列表
                    transferStatesList:[],
                    //血液状态列表
                    stateList : [],
                    processingStateList:[],

                    //ABO血型列表
                    aboBloodTypeList : [],

                    //Rh血型列表
                    rhBloodTypeList : [],
                    //血液规格字典
                    specificationList: [],

                    //血液成分列表
                    bloodComponentList : [],
                    bloodDetail:[],
                    //添加申请表单
                    dynamicValidateForm:{
                        applyId:'',
                        applyHosName:'',
                        bloodInfLists:[{
                            bloodComponent:'',
                            aboType:'',
                            rhType:'',
                            specification:''
                        }]
                    },

                    //添加功能表格
                    dialogTableVisible: false,
                    formLabelWidth: '120px',

                    //分页相关信息
                    pagination: {
                        currentPage: 1,
                        pageSize: 4,
                        total: 0,
                        //查询条件
                        id:'',
                        state : '',
                        bloodId:''
                    },

                    //样本位置
                    location: [],

                    //弹出框显示
                    dialogVisible: false,

                    //搜索样本信息
                    searchSample: {
                    },

                    //表格信息
                    tableData: [],

                    //血液信息
                    bloodTableData:[],
                    bloodData:{},



                }
            },

            //自动触发写入函数
            created(){
                this.getByQueryPage();

            },
            mounted() {
                this.getState();
                this.getAboBloodType();
                this.getRhBloodType();
                this.getBloodComponent();
                this.getTransferState();
                this.getProcessingMethod();
                this.getProcessingState();
                this.getBloodSize();
            },

            methods: {
                test(){

                },

                //加工完成
                processing(row){
                    this.processingForm.processingId = row.processingId;
                },
                //加工完成确认
                processingConfirm(){
                    axios.get('/bloodprocessing/normal/processing',{
                        params:{
                            processingId: this.processingForm.processingId,
                            postComponent: this.processingForm.postComponent,
                            postFailureTime: this.Date + ' ' + this.Time,
                        }
                    })
                    this.processingDialogVisible=false;
                    this.handleClose();

                },

                //添加血液加工信息
                submit(){
                    axios.get('/bloodtransfer/normal/getId',{
                        params:{
                            id:1001,
                            flag:100
                        }
                    }).then((res)=>{
                        if(res.data.code == '200'){
                            var id = res.data.data;
                            axios.get('/bloodprocessing/normal/insert',{
                                params:{
                                    processingId: id,
                                    processingMethod: this.bloodForm.processingMethod,

                                    bloodId: this.bloodData.bloodId,
                                    bloodBagNumber: this.bloodData.barcode,
                                    extendCode: this.bloodData.extendCode,
                                    bloodComponent: this.getBloodComponentCode(this.bloodData.bloodComponent),
                                    aboType: this.getAboBloodCode(this.bloodData.aboBloodType),
                                    rhType: this.getRhBloodCode(this.bloodData.rhBloodType),
                                    specification: this.bloodData.bloodCount,
                                    failureTime: this.bloodData.failureTime,
                                }
                            })
                        }
                    })
                    this.addDialogVisible = false;

                },

                //验证血液是否存在
                validateId(value){
                    axios.get('/bloodprocessing/normal/validate',
                        {params:{id : value,}
                        }
                    ).then(
                        (res)=>{
                            if(res.data.code == '200'){
                                this.bloodData = res.data.data;
                                // this.bloodData.bloodId = this.bloodTableData[0].bloodId;
                                this.bloodData.bloodComponent = this.getBloodComponentName(res.data.data.bloodComponent);
                                this.bloodData.aboBloodType = this.getAboBloodName(res.data.data.aboBloodType);
                                this.bloodData.rhBloodType  = this.getRhBloodName(res.data.data.rhBloodType);
                                // this.bloodData.bloodCount = this.bloodTableData[0].bloodCount;
                                // this.bloodData.barcode = this.bloodTableData[0].barcode;
                                // this.bloodData.extendCode = this.bloodTableData[0].extendCode;
                                // this.bloodData.collectTime = this.bloodTableData[0].collectTime;
                                // this.bloodData.failureTime = this.bloodTableData[0].failureTime;
                                // this.bloodData.bloodAmount = this.bloodTableData[0].bloodAmount;
                            }else{
                                this.bloodData = ''
                            }
                        }
                    )
                },
                //
                handleClose(){
                    this.processingForm.postComponent = '';
                    this.processingForm.postFailureTime = '';
                    window.setTimeout(function () {
                        window.location.reload();
                    },100)//2秒
                },

                //获取需要删除的ID
                getDelete(row){
                    this.delete = row.processingId;
                },

                rowClick(row){
                    axios.get('/applyinformation/normal/getAll',
                        {params:{
                                id:row.applyId
                            }
                        }).then((res)=>{
                        console.log("****************")
                        console.log(res.data);
                        if(res.data.code=="200"){
                            console.log(res.data.data)
                            this.bloodDetail = res.data.data;
                        }
                    });
                },
                getByQueryPage:function(flag){
                    if(flag != 1){
                        this.pagination.id = '';
                        this.pagination.bloodId = '';
                        this.pagination.state = '';
                        this.pagination.currentPage = 1;
                    }
                    axios.get('/bloodprocessing/normal/' + this.pagination.currentPage + '/' + this.pagination.pageSize,
                        {
                            params:{
                                processingId : this.pagination.id,
                                bloodId: this.pagination.bloodId,
                                processingState :this.pagination.state,
                            }
                        }).then((res)=>{
                        console.log(res.data);
                        if (res.data.code === "200") {
                            this.pagination.pageSize = res.data.data.size;
                            this.pagination.currentPage = res.data.data.current;
                            this.pagination.total = res.data.data.total;
                            this.tableData = Object.values(res.data.data.records);
                        } else{
                            this.$message.success("查询失败");
                        }
                    });
                },

                // 获取血液状态字典
                getState(){
                    axios.get('/state/normal/getName')
                        .then((res)=>{
                            if (res.data.code === '200'){
                                this.stateList = res.data.data
                            } else {
                                this.$notify.error({
                                    title : '错误',
                                    message : '获取数据失败'
                                })
                            }
                        })
                },
                // 将表格中的State字段的code转换成name
                getStateName(code){
                    for (var i=0;i<this.stateList.length;i++){
                        if (this.stateList[i].code == code){
                            return this.stateList[i].state
                        }
                    }
                },

                // 获取申请状态字典
                getTransferState(){
                    axios.get('/transferState/normal/getName')
                        .then((res)=>{
                            if (res.data.code === '200'){
                                this.transferStatesList = res.data.data
                            } else {
                                this.$notify.error({
                                    title : '错误',
                                    message : '获取数据失败'
                                })
                            }
                        })
                },
                // 将表格中的State字段的code转换成name
                getTransferStateName(code){
                    for (var i=0;i<this.transferStatesList.length;i++){
                        if (this.transferStatesList[i].code == code){
                            return this.transferStatesList[i].name
                        }
                    }
                },
                // 将表格中的State字段的name转换成code
                getTransferStateCode(name){
                    for (var i=0;i<this.transferStatesList.length;i++){
                        if (this.transferStatesList[i].name == name){
                            return this.transferStatesList[i].code
                        }
                    }
                },

                // 获取abo血型字典
                getAboBloodType(){
                    axios.get('/aboType/normal/getName')
                        .then((res)=>{
                            if (res.data.code === '200') {
                                this.aboBloodTypeList = res.data.data
                            } else {
                                this.$notify.error({
                                    title: '错误',
                                    message: '获取数据失败',
                                })
                            }
                        })
                },
                // 将表格中aboBloodType字段的code转换成name
                getAboBloodName(code){
                    for (var i = 0; i < this.aboBloodTypeList.length; i++) {
                        if (this.aboBloodTypeList[i].code == code) { //dictValue，dictLabel保持和上面定义一致
                            return this.aboBloodTypeList[i].name;
                        }
                    }
                },
                // 将表格中aboBloodType字段的code转换成name
                getAboBloodCode(name){
                    for (var i = 0; i < this.aboBloodTypeList.length; i++) {
                        if (this.aboBloodTypeList[i].name == name) { //dictValue，dictLabel保持和上面定义一致
                            return this.aboBloodTypeList[i].code;
                        }
                    }
                },

                // 获取rh血型字典
                getRhBloodType(){
                    axios.get('/rhType/normal/getName')
                        .then((res)=>{
                            if (res.data.code === '200') {
                                this.rhBloodTypeList = res.data.data
                            } else {
                                this.$notify.error({
                                    title: '错误',
                                    message: '获取数据失败',
                                })
                            }
                        })
                },
                // 将表格中rhType字段的code转换成name
                getRhBloodName(code){
                    for (var i = 0; i < this.rhBloodTypeList.length; i++) {
                        if (this.rhBloodTypeList[i].code == code) { //dictValue，dictLabel保持和上面定义一致
                            return this.rhBloodTypeList[i].name;
                        }
                    }
                },
                // 将表格中rhType字段的name转换成code
                getRhBloodCode(name){
                    for (var i = 0; i < this.rhBloodTypeList.length; i++) {
                        if (this.rhBloodTypeList[i].name == name) { //dictValue，dictLabel保持和上面定义一致
                            return this.rhBloodTypeList[i].code;
                        }
                    }
                },


                // 获取血液成分字典
                getBloodComponent(){
                    axios.get('/bloodComposition/normal/getName')
                        .then((res)=>{
                            if (res.data.code === '200') {
                                this.bloodComponentList = res.data.data
                            } else {
                                this.$notify.error({
                                    title: '错误',
                                    message: '获取数据失败',
                                })
                            }
                        })
                },
                // 将表格中bloodComponent字段的code转换成name
                getBloodComponentName(code){
                    for (var i = 0; i < this.bloodComponentList.length; i++) {
                        if (this.bloodComponentList[i].code == code) { //dictValue，dictLabel保持和上面定义一致
                            return this.bloodComponentList[i].composition;
                        }
                    }
                },
                // 将表格中bloodComponent字段的name转换成code
                getBloodComponentCode(composition ){
                    for (var i = 0; i < this.bloodComponentList.length; i++) {
                        if (this.bloodComponentList[i].composition == composition ) { //dictValue，dictLabel保持和上面定义一致
                            return this.bloodComponentList[i].code;
                        }
                    }
                },
                // 获取加工方法字典
                getProcessingMethod(){
                    axios.get('/processingMethod/normal/getName')
                        .then((res)=>{
                            if (res.data.code === '200') {
                                this.methodList = res.data.data
                            } else {
                                this.$notify.error({
                                    title: '错误',
                                    message: '获取数据失败',
                                })
                            }
                        })
                },
                // 将表格中的code转换成name
                getProcessingMethodName(code){
                    for (var i = 0; i < this.methodList.length; i++) {
                        if (this.methodList[i].code == code) { //dictValue，dictLabel保持和上面定义一致
                            return this.methodList[i].name;
                        }
                    }
                },
                // 将表格中的name转换成code
                getProcessingMethodCode(name){
                    for (var i = 0; i < this.methodList.length; i++) {
                        if (this.methodList[i].name == name ) { //dictValue，dictLabel保持和上面定义一致
                            return this.methodList[i].code;
                        }
                    }
                },

                // 获取加工状态字典
                getProcessingState(){
                    axios.get('/processingState/normal/getName')
                        .then((res)=>{
                            if (res.data.code === '200') {
                                this.processingStateList = res.data.data
                            } else {
                                this.$notify.error({
                                    title: '错误',
                                    message: '获取数据失败',
                                })
                            }
                        })
                },
                // 将表格中的code转换成name
                getProcessingStateName(code){
                    for (var i = 0; i < this.processingStateList.length; i++) {
                        if (this.processingStateList[i].code == code) { //dictValue，dictLabel保持和上面定义一致
                            return this.processingStateList[i].name;
                        }
                    }
                },
                // 将表格中的name转换成code
                getProcessingStateCode(name){
                    for (var i = 0; i < this.processingStateList.length; i++) {
                        if (this.processingStateList[i].name == name ) { //dictValue，dictLabel保持和上面定义一致
                            return this.processingStateList[i].code;
                        }
                    }
                },

                // 获取血量字典
                getBloodSize(){
                    axios.get('/bloodSize/normal/getName1')
                        .then((res)=>{
                            if (res.data.code === '200') {
                                this.specificationList = res.data.data
                            } else {
                                this.$notify.error({
                                    title: '错误',
                                    message: '获取数据失败',
                                })
                            }
                        })
                },

                // 将表格中bloodCount字段的code转换成size
                getBloodSizeName(code){
                    for (var i = 0; i < this.specificationList.length; i++) {
                        if (this.specificationList[i].code == code) { //dictValue，dictLabel保持和上面定义一致
                            return this.specificationList[i].size;
                        }
                    }
                },



                // 获取时间
                // dateFormat(picker) {
                //     this.pagination.startTime =  picker[0].getFullYear()+'-'+this.handleTimeStr(picker[0].getMonth()+1)+'-'+this.handleTimeStr(picker[0].getDate()) + ' 00:00:00';
                //     this.pagination.endTime =  picker[1].getFullYear()+'-'+this.handleTimeStr(picker[1].getMonth()+1)+'-'+this.handleTimeStr(picker[1].getDate())+ ' 00:00:00';
                // },

                // 分页查询 每页显示多少条数据
                handleSizeChange:function(pageSize){
                    this.pagination.pageSize = pageSize;
                    this.getByQueryPage(1);
                },

                //分页查询 切换页码
                handleCurrentChange:function(currentPage){
                    this.pagination.currentPage = currentPage;
                    //执行查询
                    this.getByQueryPage(1);
                },

                update(row){
                    console.log(row.applyId)
                },

                //删除申请
                deleteOne() {
                    console.log("成功")
                    axios.get('/bloodprocessing/normal/delete', {
                        params: {
                            processingId: this.delete,
                        }
                    }).then((res) => {
                        if (res.data.code == '200') {
                            this.$notify({
                                title: '成功',
                                message: '删除成功',
                                type: 'success',
                            })
                        }
                    });
                    window.setTimeout(function () {
                        window.location.reload();
                    },1000)//2秒
                },

                // 编辑表格
                editTableData(row){
                    this.bloodNumIndex = row.bloodNumber;
                },
                edit(){
                    alert("hello")
                },
                handleEdit(index, row) {
                    console.log(index, row);
                },
                handleDelete(index, row) {
                    console.log(index, row);
                },
                //取消按钮
                cancel(){

                },


                // 获取当前时间
                getNowTime(){
                    var date = new Date();
                    var year = date.getFullYear();
                    var month = date.getMonth()+1;
                    var day = date.getDate();
                    var hour = date.getHours();
                    var minute = date.getMinutes();
                    var second = date.getSeconds();

                    var time = year + '-' + this.handleTimeStr(month) + '-' +
                        this.handleTimeStr(day) + ' ' + this.handleTimeStr(hour) + ':' + this.handleTimeStr(minute)
                        + ':' + this.handleTimeStr(second);
                    console.log(time)
                    return time;
                },
                // 时间标准化
                handleTimeStr(tStr){  // 解决 10:2:2 出现各位数字格式化为 10:02:02
                    if (tStr < 10){
                        return '0'+ tStr
                    }else {
                        return tStr
                    }
                },


            }

        });
    })()
</script>

</body>

</html>